namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using Engine.Report;

    using Microsoft.SharePoint;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;
    using Entities;
    using File;

    using SharePoint.Wss.Files;
    
    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class CheckInFilesTest
    {
        [TestMethod]
        public void CheckInFiles_Test()
        {
            WSSTestAssistant<CheckInFiles, CheckInFileInfo> checkinfiles =
                    new WSSTestAssistant<CheckInFiles, CheckInFileInfo>(TestEnvironment.PublishingSite, 
                        "CheckInFilesTestWeb", "BLANKINTERNET#0");

            using (checkinfiles)
            {
                SPFile defaultAspx1 = SPFileHelper.GetFile(checkinfiles.TestWeb, "Pages", "default.aspx");
                defaultAspx1.CheckOut();

                MacroReport doReport = checkinfiles.DoMacro();

                SPFile defaultAspx2 = SPFileHelper.GetFile(checkinfiles.TestWeb, "Pages", "default.aspx");
                Assert.IsTrue(defaultAspx2.CheckOutStatus == SPFile.SPCheckOutStatus.None);

                MacroReport unDoReport = checkinfiles.UndoMacro();

                SPFile defaultAspx3 = SPFileHelper.GetFile(checkinfiles.TestWeb, "Pages", "default.aspx");
                Assert.IsTrue(defaultAspx3.CheckOutStatus == SPFile.SPCheckOutStatus.LongTerm);

            }
        }

    }
}
